using System.Windows;

namespace SharpTalk.Client.WpfApplication.ViewModels
{
    using Views;
    using System.Windows.Media;

    public sealed class DialogMessageViewModel
        : ViewModelBase<IDialogMessageView>
    {
        public DialogMessageViewModel(IDialogMessageView view)
            : base(view)
        {
            view.DataContext = this;
            ((WindowBase) View).ResizeMode = ResizeMode.NoResize;
        }

        private bool _isError = false;
        private bool _isInfo = false;

        public bool ShowButtonOk { get; set; }
        public bool ShowButtonCancel { get; set; }
        public bool ShowButtonYes { get; set; }
        public bool ShowButtonNo { get; set; }
        public string Title { get; set; }
        public string Message { get; set; }
        public bool IsError
        {
            get { return _isError; }
            set
            {
                _isError = value;
                if (!_isError) return;

                View.SetIcon(Helpers.LoadImage("alert_16.png"));
                ((WindowBase) View).BorderBrush = Brushes.Red;
            }
        }
        public bool IsInfo
        {
            get { return _isInfo; }
            set
            {
                _isInfo = value;
                if (_isInfo)
                    View.SetIcon(Helpers.LoadImage("info_16.png"));
            }
        }
       
    }
}